const mongoose = require('mongoose');

const Schema = mongoose.Schema,
    ObjectId = Schema.ObjectId;

/**
 * 手机号码详细信息，转网前后归属，归属地级市
 * @type {mongoose.Schema}
 */
let schema = new Schema({
    res: {type : String},                           //res 是否转网，0，未转网，1，已转网(明确已转网)，如返回3或4则为虚拟运营商
    mobile: {type : String, required: true, index: true},        //查询的手机号码
    area_p: {type: String},           //号码归属地，格式为：省
    area_c: {type: String},           //号码归属地，格式为：市
    init_isp: {type: String},            //最初归属的运营商
    now_isp: {type: String},              //转网后的运营商，如果未转网，则同Init_isp一致

    create_time : {type : Date, default : Date.now}
});

let model = mongoose.model('mobile_info', schema);

module.exports = model;
